package cn.wolfcode.wolf2w.business.api.factory;

import cn.wolfcode.wolf2w.business.api.RemoteNoteEsService;
import cn.wolfcode.wolf2w.business.api.domain.NoteEs;
import cn.wolfcode.wolf2w.common.core.domain.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
@Component
public class RemoteNoteEsfallbackFactory implements FallbackFactory<RemoteNoteEsService> {
    @Override
    public RemoteNoteEsService create(Throwable cause) {
        return new RemoteNoteEsService() {

            @Override
            public R<?> initNoteEs(@RequestBody NoteEs noteEs, String source) {
                return R.fail("初始化笔记es失败", cause.getMessage());
            }
        };
    }
}
